home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-imgbiu.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  67 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       S Y S T E M . I M G _ B I U                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.3 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  Contains the routine for computing the image in based format of signed and
  27. --  unsigned integers whose size <= Integer'Size for use by Text_Io.Integer_Io,
  28. --  Text_Io.Modular_Io, and the Img attribute.
  29.  
  30. with System.Unsigned_Types;
  31.  
  32. package System.Img_BIU is
  33. pragma Preelaborate (Img_BIU);
  34.  
  35.    procedure Set_Image_Based_Integer
  36.      (V : Integer;
  37.       B : Natural;
  38.       W : Integer;
  39.       S : out String;
  40.       P : in out Natural);
  41.    --  Sets the signed image of V in based format, using base value B (2..16)
  42.    --  starting at S (P + 1), updating P to point to the last character stored.
  43.    --  The image includes a leading minus sign if necessary, but no leading
  44.    --  spaces unless W is positive, in which case leading spaces are output if
  45.    --  necessary to ensure that the output string is no less than W characters
  46.    --  long. The caller promises that the buffer is large enough and no check
  47.    --  is made for this. Constraint_Error will not necessarily be raised if
  48.    --  this is violated, since it is perfectly valid to compile this unit with
  49.    --  checks off.
  50.  
  51.    procedure Set_Image_Based_Unsigned
  52.      (V : System.Unsigned_Types.Unsigned;
  53.       B : Natural;
  54.       W : Integer;
  55.       S : out String;
  56.       P : in out Natural);
  57.    --  Sets the unsigned image of V in based format, using base value B (2..16)
  58.    --  starting at S (P + 1), updating P to point to the last character stored.
  59.    --  The image includes no leading spaces unless W is positive, in which case
  60.    --  leading spaces are output if necessary to ensure that the output string
  61.    --  is no less than W characters long. The caller promises that the buffer
  62.    --  is large enough and no check is made for this. Constraint_Error will not
  63.    --  necessarily be raised if this is violated, since it is perfectly valid
  64.    --  to compile this unit with checks off).
  65.  
  66. end System.Img_BIU;
  67.